package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="system_friend_link" )
public class SystemFriendLink extends BaseObject implements Serializable {
    private Long linkId;
    private String linkHref;
    private String linkImageUrl;
    private String linkName;
    private byte showOrder;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getLinkId() {
        return this.linkId;
    }
    
    public void setLinkId(Long linkId) {
        this.linkId = linkId;
    }
    
    @Column(name="link_href", nullable=false)
    public String getLinkHref() {
        return this.linkHref;
    }
    
    public void setLinkHref(String linkHref) {
        this.linkHref = linkHref;
    }
    
    @Column(name="link_image_url", nullable=false)
    public String getLinkImageUrl() {
        return this.linkImageUrl;
    }
    
    public void setLinkImageUrl(String linkImageUrl) {
        this.linkImageUrl = linkImageUrl;
    }
    
    @Column(name="link_name", nullable=false, length=128)
    public String getLinkName() {
        return this.linkName;
    }
    
    public void setLinkName(String linkName) {
        this.linkName = linkName;
    }
    
    @Column(name="show_order", nullable=false)
    public byte getShowOrder() {
        return this.showOrder;
    }
    
    public void setShowOrder(byte showOrder) {
        this.showOrder = showOrder;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SystemFriendLink pojo = (SystemFriendLink) o;

        if (linkHref != null ? !linkHref.equals(pojo.linkHref) : pojo.linkHref != null) return false;
        if (linkImageUrl != null ? !linkImageUrl.equals(pojo.linkImageUrl) : pojo.linkImageUrl != null) return false;
        if (linkName != null ? !linkName.equals(pojo.linkName) : pojo.linkName != null) return false;
 
        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (linkHref != null ? linkHref.hashCode() : 0);
        result = 31 * result + (linkImageUrl != null ? linkImageUrl.hashCode() : 0);
        result = 31 * result + (linkName != null ? linkName.hashCode() : 0);
 
        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("linkId").append("='").append(getLinkId()).append("', ");
        sb.append("linkHref").append("='").append(getLinkHref()).append("', ");
        sb.append("linkImageUrl").append("='").append(getLinkImageUrl()).append("', ");
        sb.append("linkName").append("='").append(getLinkName()).append("', ");
        sb.append("showOrder").append("='").append(getShowOrder()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
